<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>合伙人列表</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="/public/index/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/public/index/css/iconfont.css" />
		<link rel="stylesheet" href="/public/index/css/style.css" />
		<link rel="stylesheet" href="/public/index/css/mall.css" />	
		<script type="text/javascript" src="/public/index/dist/jquery.min.js" ></script>
		<script type="text/javascript" src="/public/index/js/menudown.js" ></script>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class=" mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
			<h1 class="mui-title">合伙人列表</h1>
		</header>
		<div class="mui-content">
			<div class="my_memlisnav">
				<span style="width: 25%">昵称</span>
				<span style="width: 25%">手机号</span>
				<span style="width: 25%">注册时间</span>
				<span style="width: 25%">推荐数</span>
			</div>
			<ul class="my_memlis">

			</ul>
		</div>
		<input type="hidden" id="page" value="1" />
	</body>

</html>
<script src="/public/static/js/jquery.qrcode.js"></script>
<script src="/public/static/js/utf.js"></script>
<script>
	get_data();
	function get_data(){
			$.ajax({
			type:"post",
			data:{
				page:$("#page").val()
			},
			url:"{:url('index/admin/pt_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					for(var i=0;i<list.length;i++){
						var log=list[i];
						var count = log.count;
						if(log.count==null){
							count = 0;
						}
	    				html+=	'<li class="clearfix">'+
									'<span style="width: 30%">'+log.nick_name+'</span>'+
									'<span style="width: 30%">'+log.mobile+'</span>'+
									'<span style="width: 25%">'+log.add_time.substring(0,10)+'</span>'+
									'<span style="width: 15%">'+count+'</span>'+
								'</li>';
					}
				}else{
					html="没有记录";
				}
				$(".my_memlis").html(html);
				
			}
		});
	}
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				page:parseFloat($("#page").val())+1
			},
			url:"{:url('index/admin/pt_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var log=list[i];
						var count = log.count;
						if(log.count==null){
							count = 0;
						}
	    				html+=	'<li class="clearfix">'+
									'<span style="width: 30%">'+log.nick_name+'</span>'+
									'<span style="width: 30%">'+log.mobile+'</span>'+
									'<span style="width: 25%">'+log.add_time.substring(0,10)+'</span>'+
									'<span style="width: 15%">'+count+'</span>'+
								'</li>';
					}
				}
				$(".my_memlis").append(html);
				
			}
		});
		
		}				
	})
	
</script>
